package jeconbond.economic.systems.market;

import jeconbond.economic.resources.IResourceType;
import jeconbond.economic.resources.ResourceStorrage;

public class SellProposition implements ISellProposition {
	private IResourceType type;
	private double price;
	private ResourceStorrage sellerStorrage;
	private IMoneyAccount sellerMoneyAccount;
	
	public SellProposition(
			IResourceType type, 
			double price,
			ResourceStorrage sellerStorrage, 
			IMoneyAccount sellerMoneyAccount
	) {
		if (Double.isNaN(price) || Double.isInfinite(price)) {
			throw new RuntimeException("Invalid price value.");
		}
		this.type = type;
		this.price = price;
		this.sellerStorrage = sellerStorrage;
		this.sellerMoneyAccount = sellerMoneyAccount;
	}

	@Override
	public IResourceType getType() {
		return type;
	}

	@Override
	public double getPrice() {
		return price;
	}
	
	@Override
	public IMoneyAccount getSellerMoneyAccount() {
		return sellerMoneyAccount;
	}

	@Override
	public ResourceStorrage getSellerStorrage() {
		return sellerStorrage;
	}
}
